/*
 * elasticenergy.h
 *
 *      Author: Jerome RD Soine and Christoph A Brand
 *      Institution: Schwarz goup, Institute for Theoretical Physics, Heidelberg University, Germany
 */

#ifndef ELASTICENERGY_H_
#define ELASTICENERGY_H_

#include "../energy.h"
#include "../../geometry/geomobject.h"

class ElasticEnergy : public Energy {

protected:
	double spring_constant;
public:
	ElasticEnergy(GeomObject * G, double SPRING_CONSTANT, double prestrain);

	virtual double getEnergy();
	virtual double getEnergyOfEdge(Edge * edge);
	virtual double getForceOfEdge(Edge * edge);
	virtual Vertex getGradient(Vertex & v);

	double getSpringConstant() { return spring_constant; };
	void setSpringConstant( double SPRING_CONSTANT ) { spring_constant = SPRING_CONSTANT; };
	void initPrestrain(double prestrain);
};


#endif /* ELASTICENERGY_H_ */
